//
//  main.m
//  oc_18
//
//  Created by 楼楚 on 15/9/15.
//  Copyright (c) 2015年 Chu Lou. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Dog.h"
#import "Person.h"

int main(int argc, const char * argv[]) {
    @autoreleasepool {
      
        Dog *dog1 = [[Dog alloc]init];
        dog1.ID = 1;
        Dog *dog2 = [[Dog alloc]init];
        dog2.ID = 2;
        Person *p =[[Person alloc]init];
        [p setDog:dog1];
        [dog1 release];
         NSLog(@"%zd",dog1.retainCount);
         [p setDog:dog2];
        [dog2 release];
//        [dog1 release];
        NSLog(@"%zd",dog2.retainCount);
//        NSLog(@"%zd",p.retainCount);
//        [p release];
//         p = nil;
//         NSLog(@"%zd",p.retainCount);
        
                    
        
        
    }
    return 0;
}
